package org.frv.wispr.business;

import javax.persistence.*;
import java.util.Collection;

/**
 * Created by IntelliJ IDEA.
 * User: frvi
 * Date: Oct 9, 2007
 * Time: 1:29:00 PM
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table(name="USERS")
public class User {
    private Long id;
    private String username;
    private String password;
    private Collection<Account> accounts;

    public User() {}
    
    public User(String username, String password) {
        this.username = username;
        this.password = password;
    }

    @OneToMany(mappedBy="user")
    public Collection<Account> getAccounts() {
        return accounts;
    }

    public void setAccounts(Collection<Account> accounts) {
        this.accounts = accounts;
    }

    @Basic
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Basic
    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    @Id
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }
}
